<template>
  <a-tooltip placement="topLeft" overlayClassName="tooltipWidth">
    <template slot="title">
      <span>{{value}}</span>
    </template>
    {{ value | ellipsis(length) }}
  </a-tooltip>
</template>

<script>
  export default {
    name: 'JEllipsis',
    props: {
      value: {
        type: String,
        required: false,
      },
      length: {
        type: Number,
        required: false,
        default: 25,
      }
    },
    methods: {},
  }
</script>
<style lang="less">
.tooltipWidth {
  .ant-tooltip-inner {
    // 这里是框框
    border-radius: 20px;
    color: #333;
    padding: 10px 15px;
    box-shadow: 0px 0px 4px #333;
    background-color: rgba(255, 255, 255, 1) !important;
  }
  .ant-tooltip-arrow::before {
    // 这里是小三角形
    background-color: #fff !important;
    box-shadow: 0px 0px 4px #333;
  }
}
</style>
